package com.wzy.single;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: wzy
 * @Date: 2021/09/13/18:13
 * @Description: 饿汉式
 */
public class HungrySingleton {

    // 可能会浪费空间
    private byte[] data1 = new byte[1024 * 1024];
    private byte[] data2 = new byte[1024 * 1024];
    private byte[] data3 = new byte[1024 * 1024];
    private byte[] data4 = new byte[1024 * 1024];

    private HungrySingleton() {

    }

    private final static HungrySingleton HUNGRY = new HungrySingleton();

    public static HungrySingleton getInstance() {
        return HUNGRY;
    }
}
